'use strict';
const db = uniCloud.database()
const coll = db.collection('xuanshou')
const coll1 = db.collection('user')
const dbCmd = db.command
exports.main = async (event, context) => {
	let res = await coll.where({
		_id: event.id
	}).update({
		piao: dbCmd.inc(1)
	})

	let res1 = await coll1.where({
		_id: event.userid
	}).update({
		toupiaojihui: dbCmd.inc(-1)
	})
	let res2 = await coll1.where({
		_id: event.userid
	}).get()
	return res2
};
